<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>年级JSON</title>
</head>
<body>
<table align="center" border="1" cellpadding="0" cellspacing="0" id="gradeTable">
    <tr>
        <th>年级ID</th>
        <th>年级名称</th>

    </tr>
</table>

<script type="text/javascript" src="../AdminLTEdemo01/js/jquery-1.12.4.min.js"></script>
<script>
    $(function (){
        let t=$("#gradeTable");
        let url="";
        $.post("../GradeServlet",function (data) {
            // alert(url);
            // alert(${pageContext.request.contextPath});
            $.each(data,function (index,obj) {
                t.append("<tr><td>"+obj.id+"</td><td>"+obj.gname+"</td></tr>")
            });
        });
    });
</script>

</body>
</html>